signature TYPE_CHECK_STRUCTS =
sig
  structure Ast : AST
  structure Ir : IR
  structure Types2 : TYPES2
  structure Table : TABLE
  sharing Table.Types = Types2 = Ir.Types
  sharing Ast.Atoms = Types2.Atoms = Table.Atoms = Table.Types.Atoms
          = Ir.Atoms = Ir.Types.Atoms
end

signature TYPE_CHECK =
sig
  include TYPE_CHECK_STRUCTS
  
  structure TyCheck : 
  sig
    val ckTop : Ast.Program.t -> Ir.Program.t
  end
  
  structure RetCheck : 
  sig
    val ckTop : Ast.Program.t -> unit
  end
end
